import { handleActions } from "redux-actions";
import _ from "lodash";
import { COMMODITY_ADD_RESINFO, COMMODITY_DEL_RESINFO } from '../types'

const initData = {
    _id: "1",
    name: '甜皮鸭',
    desc: '是离别是折磨也是救赎',
    guarantee: '15天',
    aftersale: '15天无条件退换货',
    storeCondition: '干燥',
    place: '乐山',
    specs: '750g',
    pack: '袋',
    sales: 750,
    image: [],        // 商品图片
    detailsImage: []  //商品详情图片
}


export const commodityImage = handleActions({
    [COMMODITY_ADD_RESINFO]: (state, { payload }) => {
        const { data } = payload
        return _.assign({}, state, data)
    },
    [COMMODITY_DEL_RESINFO]: (state, { payload }) => {
        const { data } = payload
        return _.assign({}, state, data)
    },





}, initData)
